﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFSQLiteOneToManay.Mapping
{
    public class InspItemRecordMapping : BaseDomainMapping<InspItemRecord>
    {
        public override void Init()
        {
            ToTable("ItemRecord");
            HasKey(l => l.ID);
            Property(l => l.IID ).HasMaxLength(200).IsRequired();//设置Name属性长度为200 并且是必填
            Property(l => l.ItemMsg).HasMaxLength(200).IsOptional();
            Property(l => l.ItemName).HasMaxLength(200).IsRequired();
            HasMany(t => t.CoordinateDetails ).WithRequired(t => t.IR).HasForeignKey(t => t.CID).WillCascadeOnDelete();
        }
    }
}
